<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">

	<rich:panel id="Edit" styleClass="form">
		


			<a4j:form ajaxSingle="true">
				<h:panelGrid>
					<div class="attributes">
						<s:decorate template="/layout/input.xhtml">
								<ui:define name="label">Codigo</ui:define>
								<h:inputText value="#{editBranch.editBranch.cod}" id="BranchCode"
									required="true" size="7"
									requiredMessage="Favor introduzca un codigo"
									validatorMessage="El codigo no puede ser menor a 3 o mayor a 5">
									<f:validateLength minimum="3" maximum="5" />
									<a4j:support event="onblur" />

								</h:inputText>
								<div class="msg_container">
								<rich:message for="BranchCode"/>
								</div>
							</s:decorate>
							<div style="clear: both;" />
																								
							<s:decorate template="/layout/input.xhtml">
								<ui:define name="label">Empresa</ui:define>
							
								
								<rich:comboBox value="#{editBranch.entCod}" 
								id="BranchEnt"
								converter="#{entConverter}"
								converterMessage="Favor seleccione la empresa"
								defaultLabel="Seleccione la empresa"
								enableManualInput="false"
								required="true"
								requiredMessage="Favor seleccione la empresa">
															
									<s:selectItems  value="#{withinHolder.entList()}" var="ent" label="#{ent.cod}">
									</s:selectItems>
									
								</rich:comboBox>
								<div class="msg_container">
								<rich:message for="BranchEnt"/>
								</div>
								
							</s:decorate>
							<div style="clear: both;" />
							
							<s:decorate template="/layout/input.xhtml">
								<ui:define name="label">Descripcion</ui:define>
								<h:inputText value="#{editBranch.editBranch.descrip}" id="BranchDesc"
									required="true" size="50" maxlength="70"
									requiredMessage="Favor introduzca la descripcion"
									validatorMessage="La descripcion no puede ser menor a 3 o mayor a 70">
									<f:validateLength minimum="3" maximum="70" />
									<a4j:support event="onblur" />

								</h:inputText>
								<div class="msg_container">
								<rich:message for="BranchDesc"/>
								</div>
							</s:decorate>
							<div style="clear: both;" />
					
							<s:decorate template="/layout/input.xhtml">
								<ui:define name="label">Activo</ui:define>
								<h:selectBooleanCheckbox value="#{editBranch.editBranch.status}" id="BranchState"
								required="false" 
								validatorMessage="El estado no puede ser menor o mayor a 1">
								<a4j:support event="onblur" />
								</h:selectBooleanCheckbox>
								
								<div class="msg_container">
								<rich:message for="BranchState"/>
								</div>
							</s:decorate>
					</div>

					
						
		
				<s:decorate template="/layout/displayButton.xhtml">
					<a4j:commandButton value="Guardar"
						action="#{editBranch.dataToEditUpd()}"
						oncomplete="#{rich:component('modalPanel')}.hide()"
						reRender="BranchGridForm, BranchForm" />
					<rich:spacer width="20px" />
					<a4j:commandButton value="Cancelar"
						oncomplete="#{rich:component('modalPanel')}.hide()">
					</a4j:commandButton>
				</s:decorate>
			
			</h:panelGrid>
		</a4j:form>
	</rich:panel>
</ui:composition>